﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class frm_RightPage : System.Web.UI.Page
{
    private void GetDateSet()
    {
        DataSet dst = null;
        ClsAnnunciatorDAL cls_Annunciator = new ClsAnnunciatorDAL();

        dst = cls_Annunciator.GetAnnunciatorDataSet(0);

        if (dst != null && dst.Tables[0].Rows.Count > 0)
        {
            this.dgrdResult2.DataSource = dst;
            this.dgrdResult2.DataBind();
        }

        dst = cls_Annunciator.GetAnnunciatorDataSet(1);

        if (dst != null && dst.Tables[0].Rows.Count > 0)
        {

        }

        dst = cls_Annunciator.GetAnnunciatorDataSet(2);

        if (dst != null && dst.Tables[0].Rows.Count > 0)
        {

        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ClsPropertyDAL cls_Property = new ClsPropertyDAL();

            string strUserID = cls_Property.SetOrGetUserID;

            if (strUserID != "")
            {
                string strParam = this.Page.Request.Params["id"];

                if (strParam != null && strParam.Trim() != "" && strParam.Trim() == "-1")
                {
                    this.lblJs.Text = "<script>document.getElementById('lbtnStat').click();</script>";

                    this.GetDateSet();
                }
                else
                {
                    this.panStart.Visible = true;
                    this.panShow.Visible = false;
                }
            }
            else
            {
                this.Page.Session.Remove("SetOrGetUserID");
                this.lblJs.Text = "<script>parent.window.location.href='index.aspx'</script>";
            }
        }
        else
        {
            this.lblJs.Text = "";
        }
    }

    protected void lbtnStat_Click(object sender, EventArgs e)
    {
        this.panStart.Visible = false;
        this.panShow.Visible = true;

        this.GetDateSet();
    }

    protected void ibtnRef_Click(object sender, ImageClickEventArgs e)
    {
        this.GetDateSet();
    }

    protected void tbiExit_Click(object sender, ImageClickEventArgs e)
    {
        this.panStart.Visible = true;
        this.panShow.Visible = false;
        this.lblJs.Text = "<script>parent.window.location.href='main.aspx'</script>";
    }
}
